import { LayoutComponent } from '../layout/layout.component';
import { AuthGuard } from '../core/auth/auth-guard.service';
import { LoginComponent } from './pages/login/login.component';
import { RecoverComponent } from './pages/recover/recover.component';
import { LockComponent } from './pages/lock/lock.component';
import { MaintenanceComponent } from './pages/maintenance/maintenance.component';
import { Error404Component } from './pages/error404/error404.component';
import { Error500Component } from './pages/error500/error500.component';
export const routes = [
  {
    path: '',
    component: LayoutComponent,
    canActivate: [AuthGuard],
    children: [
      { path: '', redirectTo: 'home', pathMatch: 'full' },
      { path: 'home', loadChildren: './home/home.module#HomeModule' },
      { path: 'crm', loadChildren: './crm/crm.module#CrmModule' },
      { path: 'authority', loadChildren: './authority/authority.module#AuthorityModule' },
      { path: 'account', loadChildren: './account/account.module#AccountModule' },
      { path: 'channel', loadChildren: './channel/channel.module#ChannelModule' },
      { path: 'cust', loadChildren: './usermanage/usermanage.module#UsermanageModule' },
      { path: 'sys', loadChildren: './system/system.module#SystemModule' },
      { path: 'userinfo', loadChildren: './userinfo/user-info.module#UserInfoModule' }
    ]
  },
  { path: 'agreement', loadChildren: './agreement/agreement.module#AgreementModule' },
  { path: 'login', component: LoginComponent },
  { path: 'recover', component: RecoverComponent },
  { path: 'lock', component: LockComponent },
  { path: 'maintenance', component: MaintenanceComponent },
  { path: '404', component: Error404Component },
  { path: '500', component: Error500Component },
  { path: '**', redirectTo: 'home' }

];
